{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "ad125052",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import glob\n",
    "import os\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "import json\n",
    "import seaborn as sns\n",
    "import pickle as pkl\n",
    "import copy\n",
    "import matplotlib.patches as mpatches\n",
    "from utils import OPT_PATH as opt_path\n",
    "# refer to https://matplotlib.org/stable/api/markers_api.html\n",
    "markers = [\"o\", \"v\", \"s\", \"*\", \"D\"]\n",
    "# refer to https://matplotlib.org/stable/gallery/color/named_colors.html\n",
    "colors = ['tab:blue', 'tab:orange', 'tab:green', 'tab:red', 'tab:purple', 'tab:brown', 'tab:pink', 'tab:gray']\n",
    "# https://matplotlib.org/3.1.0/gallery/lines_bars_and_markers/linestyles.html\n",
    "linestyles = 'solid'\n",
    "# refer to https://github.com/bvalgard/Boxplots/blob/master/Boxplots.ipynb"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "05e68148",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[]"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "glob.glob(os.path.join(opt_path, '*SI_DTMI*'))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c6c7c9f5",
   "metadata": {},
   "source": [
    "### Benign v.s. I-FGSM, DTMI, DTMI-Ours"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "0d549cfa",
   "metadata": {},
   "outputs": [],
   "source": [
    "ifgsm_path = glob.glob(os.path.join(opt_path, '*-DTMI-*motivation_IFGSM/cosine_similarity.json'))\n",
    "with open(ifgsm_path[0], 'rb') as ipt:\n",
    "    ifgsm_info = pkl.load(ipt)\n",
    "    \n",
    "dtmi_path = glob.glob(os.path.join(opt_path, '*-DTMI-*motivation/cosine_similarity.json'))\n",
    "with open(dtmi_path[0], 'rb') as ipt:\n",
    "    dtmi_info = pkl.load(ipt)\n",
    "    \n",
    "our_dtmi_path = glob.glob(os.path.join(opt_path, '*-DTMI_Local_FeatureSimilarityLoss-*motivation/cosine_similarity.json'))\n",
    "with open(our_dtmi_path[0], 'rb') as ipt:\n",
    "    our_dtmi_info = pkl.load(ipt)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "69c063ff",
   "metadata": {},
   "outputs": [],
   "source": [
    "names = ['Benign'] * len(ifgsm_info[770][2][0]) + ['I-FGSM'] * len(ifgsm_info[770][2][1]) + \\\n",
    "    ['DTMI'] * len(dtmi_info[770][2][1]) + ['DTMI-LI'] * len(our_dtmi_info[770][2][1])\n",
    "info = pd.DataFrame()\n",
    "info['Calculate Cosine Similarity Between'] = names\n",
    "info['Cosine Similarity Value'] = ifgsm_info[770][2][0] + ifgsm_info[770][2][1] + dtmi_info[770][2][1] + our_dtmi_info[770][2][1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "cbac8d75",
   "metadata": {},
   "outputs": [],
   "source": [
    "info.loc[info['Calculate Cosine Similarity Between'] == 'DTMI-LI', 'Calculate Cosine Similarity Between'] = 'DTMI-SU'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "514a9641",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAARoAAADECAYAAABA8O5RAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAdnUlEQVR4nO3deViVdf7/8ec5CLiAsogKauMkoqm51WQGFCIi42i4lY6UlduFG5OaBklgY+ZQaommhNOIpjFOGZEb0jItiDqNWe4mimMqgoKELLIczu8PfpyvhMANnPtwOLwf19V1wVnu+32r59XnfO77/rw1er1ejxBCqEjb1AUIISyfBI0QQnUSNEII1UnQCCFUJ0EjhFCdBI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OgkaIYTqJGiEEKr7fwhLD/vJTuf0AAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 288x216 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.set(style='whitegrid')\n",
    "sns.set_palette(sns.color_palette(\"Paired\"))\n",
    "fig, ax = plt.subplots(figsize=(4,3))\n",
    "# g = sns.boxplot(data=df, width=0.7)#notch=True, ) # df[['p1_satisfaction','p2_satisfaction','p3_satisfaction']]\n",
    "g = sns.boxplot(x=\"Calculate Cosine Similarity Between\", y=\"Cosine Similarity Value\", data=info, \\\n",
    "                width=0.7, showfliers = False) # , \n",
    "\n",
    "plt.xlabel(\"\", fontsize=14)\n",
    "# with a descriptive title a ylabel might not be necessary\n",
    "plt.ylabel(\"Cosine similarity\", fontsize=14)\n",
    "\n",
    "# plt.xticks([0, 1, 2, 3],['Benign',''])\n",
    "# set y-axis values (I only want whole numbers)\n",
    "# plt.yticks(np.arange(0,14))\n",
    "\n",
    "# remove all borders except bottom\n",
    "sns.despine(top=True,\n",
    "            right=True,\n",
    "            left=True,\n",
    "            bottom=False)\n",
    "plt.savefig('./figures/features_cs.pdf', format='pdf', bbox_inches = 'tight')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "58e67670",
   "metadata": {},
   "source": [
    "### Rebuttal SI and Admix"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "746943ba",
   "metadata": {},
   "outputs": [],
   "source": [
    "ifgsm_path = glob.glob(os.path.join('/share_io02_ssd/zhipeng/targeted_attack_loss/', 'Loss-resnet50-NIPSDataset-Admix_DTMI-Target_CE-baseline/cosine_similarity.json'))\n",
    "with open(ifgsm_path[0], 'rb') as ipt:\n",
    "    ifgsm_info = pkl.load(ipt)\n",
    "    \n",
    "dtmi_path = glob.glob(os.path.join('/share_io02_ssd/zhipeng/targeted_attack_loss/', 'Loss-resnet50-NIPSDataset-SI_DTMI-Target_CE-baseline/cosine_similarity.json'))\n",
    "with open(dtmi_path[0], 'rb') as ipt:\n",
    "    dtmi_info = pkl.load(ipt)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "eee46ab9",
   "metadata": {},
   "outputs": [],
   "source": [
    "names = ['Admix'] * len(ifgsm_info[770][2][0]) + ['SI'] * len(ifgsm_info[770][2][1])\n",
    "info = pd.DataFrame()\n",
    "info['Calculate Cosine Similarity Between'] = names\n",
    "info['Cosine Similarity Value'] = ifgsm_info[770][2][1] + dtmi_info[770][2][1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "fcbb8aed",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAASEAAADECAYAAADQ45eeAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAb+0lEQVR4nO3de1QU5xnH8e/uhjUXVAQXWNQWjUWJ0Xppk1g1EUTlGCxopLUSexJFD2LAWhtdTwyQxjTBXBqjUXtsgtekqRokIkZibBJBbc+xNiAQvJHG4rJECFFEgy7TPzxuQxEcdHdnYZ/PXzDz7syzjv6ceWfmfXWKoigIIYRG9FoXIITwbhJCQghNSQgJITQlISSE0JSEkBBCUxJCQghNSQgJITQlISSE0JSEkBBCUxJCQghNSQgJITQlISSE0NQdWhfgrfbu3UteXp7TtvfNN98A0KNHD6dsb9KkSUycONEp2xKiLRJCnURNTQ3gvBASwl10MpRH57BgwQIAVq5cqXElQrSP9AkJITQlISSE0JSEkBBCUxJCQghNSQgJITQlISSE0JSEkBBCUxJCQghNSQgJITQlISSE0JSEkBBCUxJCQghNyVv0QtwCZw7F4uxhWKBjDcXi1hCqqKjAYrFQV1eHn58fmZmZhIaGNmuzePFiysvLHb+Xl5fz5ptvMm7cOOx2O8uXL+fAgQPodDrmzp1LfHy8O7+CEE7n9cOwKG40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Jhg0buHr1Ku+//z5//vOfvbZTVCs2m42jR486fq+qqqK2tpbevXtrWJU25EzIQ+zYsYPJkyc3WzZs2DCampqwWCy8/PLLrF+/nrCwMAYPHnxb+yoqKmLTpk1s374df39/nn/+eRYuXMj27dvx9fW9rW0Lda5evcqqVauorKzkzjvvpKmpid/85jde2Tktg5oJITQll2NCCE1JCAkhNCUhJITQlISQEEJTEkJCCE1JCAkhNCUhJITQ1H8B3xcqfRDZOZUAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 288x216 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.set(style='whitegrid')\n",
    "sns.set_palette(sns.color_palette(\"Paired\"))\n",
    "fig, ax = plt.subplots(figsize=(4,3))\n",
    "# g = sns.boxplot(data=df, width=0.7)#notch=True, ) # df[['p1_satisfaction','p2_satisfaction','p3_satisfaction']]\n",
    "g = sns.boxplot(x=\"Calculate Cosine Similarity Between\", y=\"Cosine Similarity Value\", data=info, \\\n",
    "                width=0.7, showfliers = False) # , \n",
    "\n",
    "plt.xlabel(\"\", fontsize=14)\n",
    "# with a descriptive title a ylabel might not be necessary\n",
    "plt.ylabel(\"Cosine similarity\", fontsize=14)\n",
    "\n",
    "# plt.xticks([0, 1, 2, 3],['Benign',''])\n",
    "# set y-axis values (I only want whole numbers)\n",
    "# plt.yticks(np.arange(0,14))\n",
    "\n",
    "# remove all borders except bottom\n",
    "sns.despine(top=True,\n",
    "            right=True,\n",
    "            left=True,\n",
    "            bottom=False)\n",
    "# plt.savefig('./figures/features_cs.pdf', format='pdf', bbox_inches = 'tight')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "cefb5850",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.11"
  },
  "vscode": {
   "interpreter": {
    "hash": "79e10be247e32c74e465721b76249ea10bbcb221b34115737dc8c7eb7f76b5cc"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
